//
//  ProfileViewController.m
//  Weibo
//
//  Created by Anasue on 9/9/15.
//  Copyright (c) 2015 Anasue. All rights reserved.
//

#import "ProfileViewController.h"
#import "CommonGroup.h"
#import "CommonItem.h"
#import "CommonCell.h"
#import "CommonArrowItem.h"
#import "CommonSwitchItem.h"
#import "CommonLabelItem.h"
#import "SettingViewController.h"

@interface ProfileViewController ()

@end

@implementation ProfileViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self setupGroups];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"设置" style:UIBarButtonItemStyleDone target:self action:@selector(setting)];
    
}

- (void)setting
{
    SettingViewController *settingVc = [[SettingViewController alloc]init];
    [self.navigationController pushViewController:settingVc animated:YES];
}

- (void)setupGroups
{
    [self setupGroup0];
    [self setupGroup1];
    
}

- (void)setupGroup0
{
    CommonGroup *group = [CommonGroup group];
    [self.groups addObject:group];
    CommonArrowItem *newFriend = [CommonArrowItem itemWithTitle:@"新的好友" icon:@"new_friend"];
    newFriend.badgeValue = @"5";
    group.items = @[newFriend];
}

- (void)setupGroup1
{
    // 1.创建组
    CommonGroup *group = [CommonGroup group];
    [self.groups addObject:group];
    
    // 2.设置组的所有行数据
    CommonArrowItem *album = [CommonArrowItem itemWithTitle:@"我的相册" icon:@"album"];
    album.subTitle = @"(100)";
    
    CommonArrowItem *collect = [CommonArrowItem itemWithTitle:@"我的收藏" icon:@"collect"];
    collect.subTitle = @"(10)";
    collect.badgeValue = @"1";
    
    CommonArrowItem *like = [CommonArrowItem itemWithTitle:@"赞" icon:@"like"];
    like.subTitle = @"(36)";
    like.badgeValue = @"10";
    
    group.items = @[album, collect, like];
}


@end
